package cj.studio.backend.uc.plugin.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import cj.studio.backend.uc.bo.GlobalRole;
import cj.studio.backend.uc.bo.Organization;
import cj.studio.backend.uc.bo.TenantGroup;
import cj.studio.backend.uc.bo.TenantPost;
import cj.studio.backend.uc.bo.TenantRole;
import cj.studio.backend.uc.bo.UA;
import cj.studio.backend.uc.bo.UAExample;
import cj.studio.backend.uc.bo.User;

public interface UAMapper {

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table ua
	 * @mbg.generated  Sat May 11 15:47:57 CST 2019
	 */
	long countByExample(UAExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table ua
	 * @mbg.generated  Sat May 11 15:47:57 CST 2019
	 */
	int deleteByExample(UAExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table ua
	 * @mbg.generated  Sat May 11 15:47:57 CST 2019
	 */
	int deleteByPrimaryKey(Long id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table ua
	 * @mbg.generated  Sat May 11 15:47:57 CST 2019
	 */
	int insert(UA record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table ua
	 * @mbg.generated  Sat May 11 15:47:57 CST 2019
	 */
	int insertSelective(UA record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table ua
	 * @mbg.generated  Sat May 11 15:47:57 CST 2019
	 */
	List<UA> selectByExample(UAExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table ua
	 * @mbg.generated  Sat May 11 15:47:57 CST 2019
	 */
	UA selectByPrimaryKey(Long id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table ua
	 * @mbg.generated  Sat May 11 15:47:57 CST 2019
	 */
	int updateByExampleSelective(@Param("record") UA record, @Param("example") UAExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table ua
	 * @mbg.generated  Sat May 11 15:47:57 CST 2019
	 */
	int updateByExample(@Param("record") UA record, @Param("example") UAExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table ua
	 * @mbg.generated  Sat May 11 15:47:57 CST 2019
	 */
	int updateByPrimaryKeySelective(UA record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table ua
	 * @mbg.generated  Sat May 11 15:47:57 CST 2019
	 */
	int updateByPrimaryKey(UA record);

	List<User> getUsersOnColCode(@Param("tenantCode") String tenantCode, @Param("colType") String colType,
			@Param("colCode") String colCode);

	List<User> pageUsersOnColCode(@Param("tenantCode") String tenantCode, @Param("colType") String colType,
			@Param("colCode") String colCode, @Param("currPage") int currPage, @Param("pageSize") int pageSize);

	List<GlobalRole> getRolesOnUser(@Param("userCode") String userCode, @Param("tenantCode") String tenantCode,
			@Param("colType") String colType);

	List<GlobalRole> pageRolesOnUser(@Param("userCode") String userCode, @Param("tenantCode") String tenantCode,
			@Param("colType") String colType, @Param("currPage") int currPage, @Param("pageSize") int pageSize);

	List<TenantRole> getTenantRolesOnAccount(@Param("tenantCode") String tenantCode,
			@Param("accountCode") String accountCode);

	List<TenantPost> getTenantPostsOnAccount(@Param("tenantCode") String tenantCode,
			@Param("accountCode") String accountCode);

	List<TenantGroup> getTenantGroupsOnAccount(@Param("tenantCode") String tenantCode,
			@Param("accountCode") String accountCode);

	List<Organization> getTenantOrgsOnAccount(@Param("tenantCode") String tenantCode,
			@Param("accountCode") String accountCode);

}